package com.gitee.mrj.aiboot.core.model;

import com.gitee.mrj.aiboot.annotation.config.SFDLSSize;
import com.gitee.mrj.aiboot.annotation.config.sf.type.AlainArray;
import com.gitee.mrj.aiboot.annotation.config.sf.type.AlainField;
import com.gitee.mrj.aiboot.annotation.config.sf.type.AlainInteger;
import com.gitee.mrj.aiboot.annotation.config.sf.type.AlainObject;
import com.gitee.mrj.aiboot.annotation.config.sf.type.AlainString;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.ACLType;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.SFGrid;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.SFHorizontalLayout;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.SFLayoutArraySpan;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.SFRender;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.widget.SFObjectWidget;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.widget.SFStringWidget;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.widget.extend.ObjectTabsetWidget;
import com.gitee.mrj.aiboot.annotation.config.sf.ui.widget.extend.TabsetItemWidget;
import lombok.Getter;
import lombok.Setter;
import org.springframework.core.annotation.Order;

import java.util.Set;


/**
 * date 2018-11-22.
 */

@Getter
@Setter
@SFHorizontalLayout(spanLabel = 0)
@SFGrid(value = SFGrid.Grid.TwoColumns)
@SFRender(debug = true)
@ObjectTabsetWidget
public class AibootPost {


    @AlainString(title = "编码", description = "abc", pattern = "\\w")
//    @SFError(showRequired = true)
    @Order(2)
    @SFRender(optionalHelp = "optionalHelp", optional = "optional")
    @SFGrid(value = SFGrid.Grid.OneColumn)
    @ACLType(role = {"admin4"})
    private String code;

    @AlainField(title = "名称", required = true)
    @Order(1)
//    @SFError(showRequired = false)
    @SFRender(size = SFDLSSize.SMALL)
    private String name;
    @AlainField(title = "重量", required = true)
    @SFStringWidget(addOnAfter = "前缀", addOnBefore = "后缀")
    private String weight;
    @AlainField(title = "IDA")
    private String id;

    @AlainInteger(title = "重量2", required = true, maximum = 10, minimum = 4)
    private Integer weight2;

    //    @Order(100)
//    @AlainField(title = "Post")
    @AlainObject(title = "Post")
    @SFObjectWidget(card = true)
    @SFGrid(value = SFGrid.Grid.OneColumn)
//    @SFArrayWidget
    private AibootPost2 post;
    //    @Order(100)
////    @AlainField(title = "Post")
//    @AlainObject(title = "Post2")
////    @SFArrayWidget
//    @SFGrid(value = SFGrid.Grid.TwoColumns)
//    private EruptPost2 post2;
    //
//    @AlainField(title = "Post3")
    @AlainArray(title = "Post3", minItems = 1)
    @SFGrid(value = SFGrid.Grid.OneColumn)
    @SFHorizontalLayout(spanLabel = 0)
    @SFLayoutArraySpan(24)
    @TabsetItemWidget
    private Set<AibootPost3> post3;

    @AlainArray(title = "Post4", minItems = 1)
    @SFGrid(value = SFGrid.Grid.OneColumn)
    @SFHorizontalLayout(spanLabel = 0)
    @SFLayoutArraySpan(24)
    @TabsetItemWidget
    private Set<AibootPost3> post4;
//
//    @AlainField(title = "Object")
//    @AlainObject
//    private EruptPost2 obj;
//
//    @AlainField(title = "Object3")
//    @AlainObject
//    private EruptPost2 obj3;
//
//    @AlainField(title = "Object6")
//    @AlainObject
//    private EruptPost2 obj5;
//
//    @AlainField(title = "Object8")
//    @AlainObject
//    private EruptPost2 obj6;
//
//    @AlainField(title = "Object0")
//    @AlainObject
//    private EruptPost2 obj8;

}
